<div class="listorvertime timelistcard">
    <h2><?php echo $title . ' ' . $cmbYear . '/' . $cmbMonth; ?></h2>
    <div class="clr"></div>
    <div class="w100p form_search listtimecard">
        <form id="frmSearch" method="POST" action="">
            <label><?php echo $lblYear; ?></label>
            <select class="cmbYear" name="cmbYear">
                <?php for ($i = $minYear; $i <= $maxYear; $i++) { ?>
                    <option value="<?php echo $i; ?>" <?php echo ($cmbYear == $i) ? 'selected' : ''; ?>><?php echo $i; ?></option>
                <?php } ?>
            </select>
            <label><?php echo $lblMonth; ?></label>
            <select  class="cmbMonth" name="cmbMonth">
                <?php for ($i = 1; $i <= 12; $i++) { ?>
                    <option value="<?php echo $i; ?>" <?php echo ($cmbMonth == $i) ? 'selected' : ''; ?>><?php echo $i; ?></option>
                <?php } ?>
            </select>
            <input type="submit" name="btnSearch" value="<?php echo $lblSearch; ?>" class="btnSearch fr">
        </form>
    </div>
    <div class="clr"></div>
    <div class="clr"></div>
    <table class="tbllist" border="1">
        <tr>
            <th width="5%"><?php echo $table_col_order; ?></th>
            <th width="20%"><?php echo $table_col_fullName; ?></th>
            <th width="20%"><?php echo $table_col_email; ?></th>
            <th width="10%"><?php echo $table_col_actualWorkHour; ?></th>
        </tr>
        <?php if (count($data)): ?>
            <?php $order = $page + 1; ?>
            <?php foreach ($data as $item): ?>
                <tr>
                    <td><div class="table_col table_col_order"><?php echo $order++ ?></div></td>
                    <td title="<?php echo dQuotes($item->EmployeeName); ?>"><div class="table_col tbl_fullName"><?php echo subString(dQuotes($item->EmployeeName), 25); ?></div></td>
                    <td><div class="table_col tbl_email" title="<?php echo dQuotes($item->Email); ?>"><?php echo subString(dQuotes($item->Email), 30); ?></div></td>
                    <td><div class="table_col tbl_actualWorkHour"><a title="<?php echo ((isset($item->maskMessage) && $item->maskMessage) ? dQuotes($item->maskMessage) : ''); ?>" data-employeeId="<?php echo $item->EmployeeId; ?>" href="<?php echo site_url('timecard/'); ?>" class="useritem <?php echo ((isset($item->maskError) && $item->maskError) ? 'dataerror' : ''); ?>"><?php echo $item->sumActualWorkHours; ?></a></div></td>
                </tr>
            <?php endforeach; ?>
        <?php endif; ?>
    </table>
    <div class="clr"></div>
    <div class="pagination">
        <?php echo $pagi; ?>
    </div>
    <div class="clr"></div>
    <?php if (count($data)): ?>
        <div class="wrap_salaryCalculation">
            <form id="frmSalaryCalculation" class="frmSalaryCalculation" name="frmSalaryCalculation" action="" method="POST">
                <input type="hidden" name="txtMonth" />
                <input type="hidden" name="txtYear" />
                <input type="submit" value="<?php echo $button_salaryCalculation; ?>" name="btnsalaryCalculation" class="btnsalaryCalculation">
            </form>
        </div>
        <div class="errormessage"><?php echo(isset($messageCalculation) ? $messageCalculation : ''); ?></div>
        <div class="clr"></div>
        <!--</div>-->
    <?php else: ?>
        <div class="errormessage"><?php echo(isset($emptyMessage) ? $emptyMessage : ''); ?></div>
        <a href="<?php echo base_url('/upload'); ?>" class="btn addEmoloyeeBack m10"><?php echo $this->lang->line('upload_title'); ?></a>
    <?php endif; ?>
</div>
<div class="redirectTo">
    <form class="frmRedirectTo" class="frmRedirectTo" name="frmRedirectTo" action="" method="POST">
        <input type="hidden" name="txtEmployeeID" class="employeeID" value="0">
    </form>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        /*change link action to post action*/
        $('.table_col a').click(function(e) {
            e.preventDefault();
            var url = $(this).attr('href');
            var employeeID = $(this).attr('data-employeeId');
            $('.frmRedirectTo').attr('action', url);
            $('.employeeID').val(employeeID);
            $('.frmRedirectTo').submit();
        });
    });
</script>